<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>查询该集合，并返回结果集的 MongoCursor</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="mongocollection.ensureindex.html">MongoCollection::ensureIndex</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="mongocollection.findandmodify.html">MongoCollection::findAndModify</a></div>
 <div class="up"><a href="class.mongocollection.html">MongoCollection</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="mongocollection.find" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">MongoCollection::find</h1>
  <p class="verinfo">(PECL mongo &gt;=0.9.0)</p><p class="refpurpose"><span class="refname">MongoCollection::find</span> &mdash; <span class="dc-title">查询该集合，并返回结果集的 <a href="class.mongocursor.html" class="classname">MongoCursor</a></span></p>

 </div>

 <div class="refsect1 description" id="refsect1-mongocollection.find-description">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type"><a href="class.mongocursor.html" class="type MongoCursor">MongoCursor</a></span> <span class="methodname"><strong>MongoCollection::find</strong></span>
    ([ <span class="methodparam"><span class="type">array</span> <code class="parameter">$query</code><span class="initializer"> = array()</span></span>
   [, <span class="methodparam"><span class="type">array</span> <code class="parameter">$fields</code><span class="initializer"> = array()</span></span>
  ]] )</div>

 </div>


 <div class="refsect1 parameters" id="refsect1-mongocollection.find-parameters">
  <h3 class="title">参数</h3>  
  <p class="para">
   <dl>

    
     <dt>

      <em><code class="parameter">query</code></em>
     </dt>

     <dd>

      <p class="para">
       要搜索的字段。
       MongoDB 的查询语言十分宽泛。
       PHP 驱动在几乎所有的情况下会把查询直接传入服务器，所以阅读 MongoDB 关于 <a href="http://docs.mongodb.org/manual/reference/method/db.collection.find/" class="link external">&raquo;&nbsp;find</a> 的核心文档是个不错的主意。
      </p>
      <div class="warning"><strong class="warning">Warning</strong>
       <p class="para">
        请确保所有指定的查询操作符（以 <em>$</em> 开头）是用单引号的，这样 PHP 才不会尝试用 <em>$exists</em> 变量的值来替换 <em>&quot;$exists&quot;</em> 命令。
       </p>
      </div>
     </dd>

       
    
     <dt>

      <em><code class="parameter">fields</code></em>
     </dt>

     <dd>

      <p class="para">
       返回结果的字段。Array 的格式是 <em>array(&#039;fieldname&#039; =&gt; true, &#039;fieldname2&#039; =&gt; true)</em>。
       <em>_id</em> 字段总会返回。
      </p>
     </dd>

       
   </dl>

  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-mongocollection.find-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
   返回搜索结果的游标。
  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-mongocollection.find-examples">
  <h3 class="title">范例</h3>
   <div class="example" id="example-1416">
   <p><strong>Example #1 <span class="function"><strong>MongoCollection::find()</strong></span> 例子</strong></p>
   <div class="example-contents"><p>该例子演示了基本的搜索选项。</p></div>
   <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br /><br />$m&nbsp;</span><span style="color: #007700">=&nbsp;new&nbsp;</span><span style="color: #0000BB">MongoClient</span><span style="color: #007700">();<br /></span><span style="color: #0000BB">$db&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">$m</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">selectDB</span><span style="color: #007700">(</span><span style="color: #DD0000">'test'</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">$collection&nbsp;</span><span style="color: #007700">=&nbsp;new&nbsp;</span><span style="color: #0000BB">MongoCollection</span><span style="color: #007700">(</span><span style="color: #0000BB">$db</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">'produce'</span><span style="color: #007700">);<br /><br /></span><span style="color: #FF8000">//&nbsp;搜索水果<br /></span><span style="color: #0000BB">$fruitQuery&nbsp;</span><span style="color: #007700">=&nbsp;array(</span><span style="color: #DD0000">'Type'&nbsp;</span><span style="color: #007700">=&gt;&nbsp;</span><span style="color: #DD0000">'Fruit'</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB">$cursor&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">$collection</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">find</span><span style="color: #007700">(</span><span style="color: #0000BB">$fruitQuery</span><span style="color: #007700">);<br />foreach&nbsp;(</span><span style="color: #0000BB">$cursor&nbsp;</span><span style="color: #007700">as&nbsp;</span><span style="color: #0000BB">$doc</span><span style="color: #007700">)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">var_dump</span><span style="color: #007700">(</span><span style="color: #0000BB">$doc</span><span style="color: #007700">);<br />}<br /><br /></span><span style="color: #FF8000">//&nbsp;搜索甜的产品&nbsp;Taste&nbsp;is&nbsp;a&nbsp;child&nbsp;of&nbsp;Details.&nbsp;<br /></span><span style="color: #0000BB">$sweetQuery&nbsp;</span><span style="color: #007700">=&nbsp;array(</span><span style="color: #DD0000">'Details.Taste'&nbsp;</span><span style="color: #007700">=&gt;&nbsp;</span><span style="color: #DD0000">'Sweet'</span><span style="color: #007700">);<br />echo&nbsp;</span><span style="color: #DD0000">"Sweet\n"</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">$cursor&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">$collection</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">find</span><span style="color: #007700">(</span><span style="color: #0000BB">$sweetQuery</span><span style="color: #007700">);<br />foreach&nbsp;(</span><span style="color: #0000BB">$cursor&nbsp;</span><span style="color: #007700">as&nbsp;</span><span style="color: #0000BB">$doc</span><span style="color: #007700">)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">var_dump</span><span style="color: #007700">(</span><span style="color: #0000BB">$doc</span><span style="color: #007700">);<br />}<br /><br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</code></div>
   </div>

   <div class="example-contents"><p>以上例程会输出：</p></div>
   <div class="example-contents screen">
<div class="cdata"><pre>
array(4) {
  [&quot;_id&quot;]=&gt;
  object(MongoId)#7 (1) {
    [&quot;$id&quot;]=&gt;
    string(24) &quot;50a87dd084f045a19b220dd6&quot;
  }
  [&quot;Name&quot;]=&gt;
  string(5) &quot;Apple&quot;
  [&quot;Type&quot;]=&gt;
  string(5) &quot;Fruit&quot;
  [&quot;Details&quot;]=&gt;
  array(2) {
    [&quot;Taste&quot;]=&gt;
    string(5) &quot;Sweet&quot;
    [&quot;Colour&quot;]=&gt;
    string(3) &quot;Red&quot;
  }
}
array(4) {
  [&quot;_id&quot;]=&gt;
  object(MongoId)#8 (1) {
    [&quot;$id&quot;]=&gt;
    string(24) &quot;50a87de084f045a19b220dd7&quot;
  }
  [&quot;Name&quot;]=&gt;
  string(5) &quot;Lemon&quot;
  [&quot;Type&quot;]=&gt;
  string(5) &quot;Fruit&quot;
  [&quot;Details&quot;]=&gt;
  array(2) {
    [&quot;Taste&quot;]=&gt;
    string(4) &quot;Sour&quot;
    [&quot;Colour&quot;]=&gt;
    string(5) &quot;Green&quot;
  }
}

Sweet:
array(4) {
  [&quot;_id&quot;]=&gt;
  object(MongoId)#7 (1) {
    [&quot;$id&quot;]=&gt;
    string(24) &quot;50a87dd084f045a19b220dd6&quot;
  }
  [&quot;Name&quot;]=&gt;
  string(5) &quot;Apple&quot;
  [&quot;Type&quot;]=&gt;
  string(5) &quot;Fruit&quot;
  [&quot;Details&quot;]=&gt;
  array(2) {
    [&quot;Taste&quot;]=&gt;
    string(5) &quot;Sweet&quot;
    [&quot;Colour&quot;]=&gt;
    string(3) &quot;Red&quot;
  }
}
</pre></div>
   </div>
   <div class="example-contents"><p>
    更多关于游标如何使用的信息，参见 <a href="class.mongocursor.html" class="classname">MongoCursor</a>。
   </p></div>
  </div>
  <div class="example" id="example-1417">
   <p><strong>Example #2 <span class="function"><strong>MongoCollection::find()</strong></span> 例子</strong></p>
   <div class="example-contents"><p>这个例子演示了如何搜索一个范围。</p></div>
   <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br /><br />$m&nbsp;</span><span style="color: #007700">=&nbsp;new&nbsp;</span><span style="color: #0000BB">MongoClient</span><span style="color: #007700">();<br /></span><span style="color: #0000BB">$db&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">$m</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">selectDB</span><span style="color: #007700">(</span><span style="color: #DD0000">'test'</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">$collection&nbsp;</span><span style="color: #007700">=&nbsp;new&nbsp;</span><span style="color: #0000BB">MongoCollection</span><span style="color: #007700">(</span><span style="color: #0000BB">$db</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">'phpmanual'</span><span style="color: #007700">);<br /><br /></span><span style="color: #FF8000">//&nbsp;search&nbsp;for&nbsp;documents&nbsp;where&nbsp;5&nbsp;&lt;&nbsp;x&nbsp;&lt;&nbsp;20<br /></span><span style="color: #0000BB">$rangeQuery&nbsp;</span><span style="color: #007700">=&nbsp;array(</span><span style="color: #DD0000">'x'&nbsp;</span><span style="color: #007700">=&gt;&nbsp;array(&nbsp;</span><span style="color: #DD0000">'$gt'&nbsp;</span><span style="color: #007700">=&gt;&nbsp;</span><span style="color: #0000BB">5</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">'$lt'&nbsp;</span><span style="color: #007700">=&gt;&nbsp;</span><span style="color: #0000BB">20&nbsp;</span><span style="color: #007700">));<br /><br /></span><span style="color: #0000BB">$cursor&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">$collection</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">find</span><span style="color: #007700">(</span><span style="color: #0000BB">$rangeQuery</span><span style="color: #007700">);<br />foreach&nbsp;(</span><span style="color: #0000BB">$cursor&nbsp;</span><span style="color: #007700">as&nbsp;</span><span style="color: #0000BB">$doc</span><span style="color: #007700">)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">var_dump</span><span style="color: #007700">(</span><span style="color: #0000BB">$doc</span><span style="color: #007700">);<br />}<br /><br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</code></div>
   </div>

   <div class="example-contents"><p>以上例程会输出：</p></div>
   <div class="example-contents screen">
<div class="cdata"><pre>
array(2) {
  [&quot;_id&quot;]=&gt;
  object(MongoId)#10 (1) {
    [&quot;$id&quot;]=&gt;
    string(24) &quot;4ebc3e3710b89f2349000000&quot;
  }
  [&quot;x&quot;]=&gt;
  int(12)
}
array(2) {
  [&quot;_id&quot;]=&gt;
  object(MongoId)#11 (1) {
    [&quot;$id&quot;]=&gt;
    string(24) &quot;4ebc3e3710b89f2349000001&quot;
  }
  [&quot;x&quot;]=&gt;
  int(12)
}
</pre></div>
   </div>
   <div class="example-contents"><p>
    更多关于游标如何使用的信息，参见 <a href="class.mongocursor.html" class="classname">MongoCursor</a>。
   </p></div>
  </div>
  <div class="example" id="example-1418">
   <p><strong>Example #3 使用 $where 的 <span class="function"><strong>MongoCollection::find()</strong></span> 例子</strong></p>
   <div class="example-contents"><p>这个例子演示了如何搜索一个集合，并用 javascript 代码来筛选结果集。</p></div>
   <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br /><br />$m&nbsp;</span><span style="color: #007700">=&nbsp;new&nbsp;</span><span style="color: #0000BB">MongoClient</span><span style="color: #007700">();<br /></span><span style="color: #0000BB">$db&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">$m</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">selectDB</span><span style="color: #007700">(</span><span style="color: #DD0000">'test'</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">$collection&nbsp;</span><span style="color: #007700">=&nbsp;new&nbsp;</span><span style="color: #0000BB">MongoCollection</span><span style="color: #007700">(</span><span style="color: #0000BB">$db</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">'phpmanual'</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB">$js&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">"function()&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;this.name&nbsp;==&nbsp;'Joe'&nbsp;||&nbsp;this.age&nbsp;==&nbsp;50;<br />}"</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">$cursor&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">$collection</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">find</span><span style="color: #007700">(array(</span><span style="color: #DD0000">'$where'&nbsp;</span><span style="color: #007700">=&gt;&nbsp;</span><span style="color: #0000BB">$js</span><span style="color: #007700">));<br />foreach&nbsp;(</span><span style="color: #0000BB">$cursor&nbsp;</span><span style="color: #007700">as&nbsp;</span><span style="color: #0000BB">$doc</span><span style="color: #007700">)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">var_dump</span><span style="color: #007700">(</span><span style="color: #0000BB">$doc</span><span style="color: #007700">);<br />}<br /><br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</code></div>
   </div>

   <div class="example-contents"><p>以上例程会输出：</p></div>
   <div class="example-contents screen">
<div class="cdata"><pre>
array(3) {
  [&quot;_id&quot;]=&gt;
  object(MongoId)#7 (1) {
    [&quot;$id&quot;]=&gt;
    string(24) &quot;4ebc3e3710b89f2349000002&quot;
  }
  [&quot;name&quot;]=&gt;
  string(3) &quot;Joe&quot;
  [&quot;age&quot;]=&gt;
  int(20)
}
</pre></div>
   </div>
  </div>
  <div class="example" id="example-1419">
   <p><strong>Example #4 使用 $in 的 <span class="function"><strong>MongoCollection::find()</strong></span> 例子</strong></p>
   <div class="example-contents"><p>这个例子演示了使用 $in 操作符来搜索集合。</p></div>
   <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br /><br />$m&nbsp;</span><span style="color: #007700">=&nbsp;new&nbsp;</span><span style="color: #0000BB">MongoClient</span><span style="color: #007700">();<br /></span><span style="color: #0000BB">$db&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">$m</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">selectDB</span><span style="color: #007700">(</span><span style="color: #DD0000">'test'</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">$collection&nbsp;</span><span style="color: #007700">=&nbsp;new&nbsp;</span><span style="color: #0000BB">MongoCollection</span><span style="color: #007700">(</span><span style="color: #0000BB">$db</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">'phpmanual'</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB">$cursor&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">$collection</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">find</span><span style="color: #007700">(array(<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #DD0000">'name'&nbsp;</span><span style="color: #007700">=&gt;&nbsp;array(</span><span style="color: #DD0000">'$in'&nbsp;</span><span style="color: #007700">=&gt;&nbsp;array(</span><span style="color: #DD0000">'Joe'</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">'Wendy'</span><span style="color: #007700">))<br />));<br /><br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</code></div>
   </div>

   <div class="example-contents"><p>以上例程会输出：</p></div>
   <div class="example-contents screen">
<div class="cdata"><pre>
array(3) {
  [&quot;_id&quot;]=&gt;
  object(MongoId)#7 (1) {
    [&quot;$id&quot;]=&gt;
    string(24) &quot;4ebc3e3710b89f2349000002&quot;
  }
  [&quot;name&quot;]=&gt;
  string(3) &quot;Joe&quot;
  [&quot;age&quot;]=&gt;
  int(20)
}
</pre></div>
   </div>
  </div>

  <div class="example" id="example-1420">
   <p><strong>Example #5 以数组形式获取结果集</strong></p>
   <div class="example-contents"><p>
    返回 <a href="class.mongocursor.html" class="classname">MongoCursor</a>。
    常常在开始的时候，人们更习惯使用数组。
    使用 <span class="function"><a href="function.iterator-to-array.html" class="function">iterator_to_array()</a></span> 将游标转换成一个数组。
   </p></div>
   <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br /><br />$m&nbsp;</span><span style="color: #007700">=&nbsp;new&nbsp;</span><span style="color: #0000BB">MongoClient</span><span style="color: #007700">();<br /></span><span style="color: #0000BB">$db&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">$m</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">selectDB</span><span style="color: #007700">(</span><span style="color: #DD0000">'test'</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">$collection&nbsp;</span><span style="color: #007700">=&nbsp;new&nbsp;</span><span style="color: #0000BB">MongoCollection</span><span style="color: #007700">(</span><span style="color: #0000BB">$db</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">'phpmanual'</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB">$cursor&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">$collection</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">find</span><span style="color: #007700">();<br /></span><span style="color: #0000BB">$array&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">iterator_to_array</span><span style="color: #007700">(</span><span style="color: #0000BB">$cursor</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</code></div>
   </div>

   <div class="example-contents"><p>以上例程会输出：</p></div>
   <div class="example-contents screen">
<div class="cdata"><pre>
array(3) {
  [&quot;4ebc40af10b89f5149000000&quot;]=&gt;
  array(2) {
    [&quot;_id&quot;]=&gt;
    object(MongoId)#6 (1) {
      [&quot;$id&quot;]=&gt;
      string(24) &quot;4ebc40af10b89f5149000000&quot;
    }
    [&quot;x&quot;]=&gt;
    int(12)
  }
  [&quot;4ebc40af10b89f5149000001&quot;]=&gt;
  array(2) {
    [&quot;_id&quot;]=&gt;
    object(MongoId)#11 (1) {
      [&quot;$id&quot;]=&gt;
      string(24) &quot;4ebc40af10b89f5149000001&quot;
    }
    [&quot;x&quot;]=&gt;
    int(12)
  }
  [&quot;4ebc40af10b89f5149000002&quot;]=&gt;
  array(3) {
    [&quot;_id&quot;]=&gt;
    object(MongoId)#12 (1) {
      [&quot;$id&quot;]=&gt;
      string(24) &quot;4ebc40af10b89f5149000002&quot;
    }
    [&quot;name&quot;]=&gt;
    string(3) &quot;Joe&quot;
    [&quot;age&quot;]=&gt;
    int(20)
  }
}
</pre></div>
   </div>
   <div class="example-contents"><p>
    使用 <span class="function"><a href="function.iterator-to-array.html" class="function">iterator_to_array()</a></span> 会让驱动将强制载入所有搜索结果集到内存，所以对超过内存大小的结果集不要这么做！
   </p></div>
   <div class="example-contents"><p>
    同时，有些系统集合不具有 <em>_id</em> 字段。
    如果你处理一个可能没有 <em>_id</em> 字段的集合，需要将 <strong><code>FALSE</code></strong> 传入
    <span class="function"><a href="function.iterator-to-array.html" class="function">iterator_to_array()</a></span> 第二个参数（这样它不会尝试使用不存在的 <em>_id</em> 的值作为数组键）。
   </p></div>
  </div>
 </div>


 <div class="refsect1 seealso" id="refsect1-mongocollection.find-seealso">
  <h3 class="title">参见</h3>
  <ul class="simplelist">
   <li class="member"><span class="function"><a href="mongocollection.findone.html" class="function" rel="rdfs-seeAlso">MongoCollection::findOne()</a> - Queries this collection, returning a single element</span></li>
   <li class="member"><span class="function"><a href="mongocollection.insert.html" class="function" rel="rdfs-seeAlso">MongoCollection::insert()</a> - 插入文档到集合中</span></li>
   <li class="member">MongoDB <a href="http://docs.mongodb.org/manual/reference/method/db.collection.find/" class="link external">&raquo;&nbsp;find</a> 的核心文档。</li>
  </ul>
 </div>


</div><hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="mongocollection.ensureindex.html">MongoCollection::ensureIndex</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="mongocollection.findandmodify.html">MongoCollection::findAndModify</a></div>
 <div class="up"><a href="class.mongocollection.html">MongoCollection</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>
